package com.xoms.front.util.pay.wx;

/**
 * 常量
 */
public class WXPayConstants {

	public enum SignType {
		MD5, HMACSHA256
	}

	public static final String RESPONSE_ENCODE = "ISO-8859-1";
	public static final String RESPONSE_ENCODE_UTF_8 = "utf-8";

	public static final String HTTPS_PREFIX = "https://";

	public static final String DOMAIN_API = "api.mch.weixin.qq.com";
	public static final String DOMAIN_API2 = "api2.mch.weixin.qq.com";
	public static final String DOMAIN_APIHK = "apihk.mch.weixin.qq.com";
	public static final String DOMAIN_APIUS = "apius.mch.weixin.qq.com";

	public static final String FAIL = "FAIL";
	public static final String SUCCESS = "SUCCESS";

	// 支付状态
	public static final String TRADE_STATE_SUCCESS = "SUCCESS"; // 支付成功
	public static final String TRADE_STATE_REFUND = "REFUND"; // 转入退款
	public static final String TRADE_STATE_NOTPAY = "NOTPAY"; // 未支付
	public static final String TRADE_STATE_CLOSED = "CLOSED"; // 已关闭
	public static final String TRADE_STATE_REVOKED = "REVOKED"; // 已撤销（刷卡支付）
	public static final String TRADE_STATE_USERPAYING = "USERPAYING"; // 用户支付中
	public static final String TRADE_STATE_PAYERROR = "PAYERROR"; // 支付失败(其他原因，如银行返回失败)

	public static final String HMACSHA256 = "HMAC-SHA256";
	public static final String MD5 = "MD5";

	public static final String FIELD_SIGN = "sign";
	public static final String FIELD_SIGN_TYPE = "sign_type";

	// 交易类型
	public static final String TRADE_TYPE_JSAPI = "JSAPI"; // --公众号支付
	public static final String TRADE_TYPE_NATIVE = "NATIVE"; // --原生扫码支付、
	public static final String TRADE_TYPE_APP = "APP"; // --app支付，统一下单接口trade_type的传参可参考这里
	public static final String TRADE_TYPE_MICROPAY = "MICROPAY"; // --刷卡支付，刷卡支付有单独的支付接口，不调用统一下单接口

	// 提交刷卡支付
	public static final String MICROPAY_URL_SUFFIX = "/pay/micropay";
	// 统一下单
	public static final String UNIFIEDORDER_URL_SUFFIX = "/pay/unifiedorder";
	// 查询订单
	public static final String ORDERQUERY_URL_SUFFIX = "/pay/orderquery";
	public static final String REVERSE_URL_SUFFIX = "/secapi/pay/reverse";
	public static final String CLOSEORDER_URL_SUFFIX = "/pay/closeorder";
	public static final String REFUND_URL_SUFFIX = "/secapi/pay/refund";
	public static final String REFUNDQUERY_URL_SUFFIX = "/pay/refundquery";
	public static final String DOWNLOADBILL_URL_SUFFIX = "/pay/downloadbill";
	public static final String REPORT_URL_SUFFIX = "/payitil/report";
	public static final String SHORTURL_URL_SUFFIX = "/tools/shorturl";
	public static final String AUTHCODETOOPENID_URL_SUFFIX = "/tools/authcodetoopenid";

	// sandbox
	public static final String SANDBOX_MICROPAY_URL_SUFFIX = "/sandboxnew/pay/micropay";
	public static final String SANDBOX_UNIFIEDORDER_URL_SUFFIX = "/sandboxnew/pay/unifiedorder";
	public static final String SANDBOX_ORDERQUERY_URL_SUFFIX = "/sandboxnew/pay/orderquery";
	public static final String SANDBOX_REVERSE_URL_SUFFIX = "/sandboxnew/secapi/pay/reverse";
	public static final String SANDBOX_CLOSEORDER_URL_SUFFIX = "/sandboxnew/pay/closeorder";
	public static final String SANDBOX_REFUND_URL_SUFFIX = "/sandboxnew/secapi/pay/refund";
	public static final String SANDBOX_REFUNDQUERY_URL_SUFFIX = "/sandboxnew/pay/refundquery";
	public static final String SANDBOX_DOWNLOADBILL_URL_SUFFIX = "/sandboxnew/pay/downloadbill";
	public static final String SANDBOX_REPORT_URL_SUFFIX = "/sandboxnew/payitil/report";
	public static final String SANDBOX_SHORTURL_URL_SUFFIX = "/sandboxnew/tools/shorturl";
	public static final String SANDBOX_AUTHCODETOOPENID_URL_SUFFIX = "/sandboxnew/tools/authcodetoopenid";
}
